Digital images are commonly used in several applications such as, for example, in digital still cameras (DSC). A digital image includes a matrix of elements, commonly referred to as a bit map. Each element of the matrix, which represents an elemental area of the image (a pixel or pel), is formed by several digital values indicating corresponding components of the pixel. Digital images are typically subjected to a compression process to increase the number of digital images which can be stored simultaneously, such as onto a memory of the camera. Moreover, this allows transmission of digital images to be easier and less time consuming. A compression method commonly used in standard applications is the JPEG (Joint Photographic Experts Group) algorithm, described in CCITT T.81, 1992.
In the JPEG algorithm, 8×8 pixel blocks are extracted from the digital image. Discrete Cosine Transform (DCT) coefficients are then calculated for the components of each block. The DCT coefficients are rounded off using corresponding quantization tables. The quantized DCT coefficients are encoded to obtain a compressed digital image (from which the corresponding original digital image can be extracted later on by a decompression process). In some applications, it may be desired to provide a substantially constant memory requirement for each compressed digital image. This problem may be particularly applicable in digital still cameras. In this case it may be ensured that a minimum number of compressed digital images can be stored onto the memory of the camera, to guarantee that a minimum number of photos can be taken by the camera.
The compression factor control, or rate control is quite difficult in algorithms, such as the JPEG, wherein the size of the compressed digital image depends on the content of the corresponding original digital image. Procedures for compression of JPEG images include adjusting a gain factor that multiplies the quantizers contained in quantization tables.
The object of the rate control procedures in particular is to find the value of the gain factor that allows creating a compressed image with a predefined output file size by controlling the bit per pixel (bpp) value.
The procedures for JPEG rate control can be divided in two categories: iterative and statistical. The iterative procedures adjust, by way of iterative steps, the value of the gain factor to achieve the desired bit per pixel value. At each step the resulting bit per pixel produced by the compression operation is compared with the desired bit per pixel value and the gain factor is modified accordingly. Statistical procedures evaluate the required gain factor G considering statistical relations between the target bit per pixel value and the gain factor.
Furthermore, JPEG rate control procedures can be classified by a constant precision or by a constant number of cycles. In the case of the constant precision procedures, the cycle is repeated until the bit rate is out of the predefined precision range. The advantage of constant precision procedures is that precision is always guaranteed, but neither time nor power consumption involved by the compression operation are predictable. On the contrary, in the case of a constant number of cycles, the precision that will be achieved is unpredictable, while time and power consumption are fixed and limited.
FIG. 1 shows a block diagram of a JPEG compression chain. In FIG. 1, the input image data, indicated with reference I, is fed to a Discrete Cosine Transform (DCT) block 10, and then to a Quantization block 20. The Quantization block 20 receives and uses a scaled quantization level {tilde over (Q)} that is calculated as the product between a gain factor G and a Quantization level Q, according the relation shown in Eq. 1.{tilde over (Q)}=G·Q  Eq. 1
The Quantization level Q is selected in a Quantization Table 60. The quantized output from Quantization block 20 is then fed to a Zig-Zag Order block 30 and then to a Huffman Coding block 40. The Huffman Coding block 40 uses the output signal from Zig-Zag Order block 30 and a Huffman Table 50 to generate the JPEG Compressed Image O.
From EP-A-1 179 024; EP-A-1 173 036; EU-A-1, 179,026 and A. Bruna, M. Mancuso, “JPEG compression factor control: a new algorithm”, ICCE International Conference on Consumer Electronics, 19-21 Jun. 2001, Page(s): 206-207, a procedure for JPEG rate control based on statistical properties of JPEG compression procedure is known. Such a procedure is based on a statistical relationship between the bit per pixel value (bpp) and gain factor. In particular, the considered relation is established between the gain factor and the bit per pixel value when the image is compressed with fixed quantization tables.
Such a procedure is a constant cycles procedure that includes just one cycle, but includes two phases: a first “retrieving” phase and a second “rate control” phase. The first “retrieving” phase is used to evaluate the parameters to solve the statistical model. The function that binds the gain factor to the bit per pixel value obtained by operating a compression of the images with a pre-set factor is approximated with a parabola or a quadratic relationship.
The main steps of such a procedure can be then summarized as follows:
calculating for all the images of the database a gain factor Gain* producing the target bit per pixel value (for example by way of a bisection algorithm);
choosing an intermediate value of gain factor Int_G for operating a first compression, considering the gain factor value producing the minimum spreading of the couples <bpp, Gain*> on the set of images of the database; and
using a parabolic function to interpolate the gain factor Gain* versus the bit per pixel value bpp of the compressed image data obtained applying the value of gain factor Int_G, according to the following equation:G=a·bp2+b·bp+c  Eq. 2where a, b, c indicate the coefficients of the parabolic function.
The retrieving phase outputs the value of gain factor Int_G for the first compression and the coefficients of the parabola (a, b, c). These values are put in relation with the database image, to the target bit per pixel and to Luminance-Bandwidth-Chrominance (YUV) sub-sampling parameters. When some of these parameters are changed the values for the changed settings must be retrieved. For the applications, i.e. in digital still cameras, all managed cases are considered previously and the related settings are retrieved.
FIG. 2 schematically illustrates the main steps performed in the rate control phase with the statistical procedure, that include:
compressing the image data I, using prescaled quantization tables according to the intermediate value of gain factor Int_G in a JPEG compressor block 70;
using the bit per pixel value bpp of the image outputted from JPEG compressor block 70 to estimate a gain factor defined as statistical gain Gs by way of the parabolic function shown in Eq. 2. In FIG. 2 such an estimation step is symbolized by a graph 80 that shows the relation between the gain factor Gain* calculated on the image database and bit per pixel value bpp; and
using the estimated gain factor Gs for a final JPEG compression step similar to the compression step of block 70, but not shown in FIG. 2.
The topics considered in the foregoing form the subject of extensive technical literature, such as:
CCITT-Recommendation T.81: “information technology—Digital compression and coding of continuous tone still images”—Requirements and guidelines (1992);
“Sensors, cameras and applications for digital photography”—Proceedings of SPIE (Vol. 3650, January 1999);
Blaskaran, Konstantinides, “Image and video compression standards”—(pag. 86-93);
Nakagawa et al, “DCT-based still image compression ICS with Bit-Rate Control”—.—IEEE Trans. on Consumer Electronics, Vol. 38, No. 3, August 1992; and
Wook Joong Lim et al., “A bit allocation method based on picture activity for still image coding”—IEEE Trans. on Image Proc., Vol. 8, No. 7, July 1999.